﻿#include"HaffmanEncoder.h"
#include"HaffmanDecoder.h"
#include <iostream>

int main()
{
	int ask;
	std::cout << "Choose mode(1 - encrypt, 2 - decrypt):" << std::endl;
	std::cin >> ask;
	
	if(1 == ask)
	{
		char a[256], b[256];
		std::cout << "Enter name of input file:" << std::endl;
		std::cin >> a;
		std::cout << "Enter name of encrypted file:" << std::endl;
		std::cin >> b;
	
		HaffmanEncoder encodeMachine;
		encodeMachine.start(a,b);
	}
	else
		if(2 == ask)
		{
			char a[256], b[256];
			std::cout << "Enter name of encrypted file:" << std::endl;
			std::cin >> a;
			std::cout << "Enter name of output file:" << std::endl;
			std::cin >> b;

			HaffmanDecoder decodeMachine;
			decodeMachine.start(a,b);
		}
	
	std::cout << "Done!" << std::endl;
	
	HaffmanDecoder decodeMachine;
	decodeMachine.start("2.txt","3.txt");
	system("pause");
    return 0;
}
